﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace DGM.Util.Helpers.String
{
    public static class RegexHelper
    {
        public static bool IsUrl(string text)
        {
            string regexString = @"^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&amp;%\$#\=~])*[^\.\,\)\(\s]$";

            Match m = Regex.Match(text,regexString);

            return m.Success;
        }
    }
}
